package com.chinamoney.wppm.service;

import java.util.List;
import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.chinamoney.wppm.entity.EleForm;
import com.chinamoney.wppm.util.ResultMessage;

/**
 * 
 * @author Jason_Jiang
 *
 */
@FeignClient(name = "wppm-prov-eform")
public interface EformService {
	
	/**
	 * 获取需求变更单的花费
	 * @param name
	 * @return
	 */
	@RequestMapping(value = "bdm/dc/{name}", method = RequestMethod.GET)
	public ResultMessage<?> getDemandChangeCost(@PathVariable("name") String name);
	
	/**
	 * 根据ID获取部门预算
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "bdm/{id}", method = RequestMethod.GET)
	public ResultMessage<?> getBdmById(@PathVariable("id") String id);
	
	/**
	 * 获取预算花费明细
	 * @param budgetFrom
	 * @param statelabels
	 * @return
	 */
	@RequestMapping(value="eform/list/bdm/{budgetFrom}", method = RequestMethod.GET)
	public ResultMessage<?> getEformsByBdm(@PathVariable("budgetFrom") String budgetFrom,  @RequestParam(value = "statelabels") String statelabels);
	
	/**
	 * 获取预算花费情况（根据电子需求单的工作量评估进行计算）
	 * @param budgetFrom
	 * @param statelabels
	 * @return
	 */
	@RequestMapping(value="eform/cost/{budgetFrom}", method = RequestMethod.GET)
	public ResultMessage<?> getBdmCostByStatelabel(@PathVariable("budgetFrom") String budgetFrom,  @RequestParam(value = "statelabels") String statelabels);
	
	
	/**
	 * 根据id获取电子需求单
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "eform/{id}", method = RequestMethod.GET)
	ResultMessage<EleForm> getEformById(@PathVariable("id") String id);
	
	
	/**
	 * 获取电子需求单列表
	 * @param code
	 * @param businessName
	 * @param stateNow
	 * @param limit
	 * @param offset
	 * @return
	 */
	@RequestMapping(value= "eform/list", method = RequestMethod.GET)
	public Map<String, Object> getEleForms(
			@RequestParam(value = "code", required = false, defaultValue = "") String code,
			@RequestParam(value = "businessName", required = false, defaultValue = "") String businessName,
			@RequestParam(value = "stateNow", required = false, defaultValue = "") String stateNow
			, @RequestParam(value = "limit") Integer limit
			, @RequestParam(value = "offset") Integer offset);
	
	/**
	 * 根据预算获取对应的需求单
	 * 
	 * @param id 预算管理的ID
	 * @return
	 */
	@RequestMapping(value = "eform/bdm/{id}", method = RequestMethod.GET)
	public Map<String, Object> getFormsByBdm(@PathVariable("id") String id, @RequestParam(value = "limit") Integer limit, @RequestParam(value = "offset") Integer offset);
	
	/**
	 * 电子需求单使用情况
	 * @param rows
	 * @return
	 */
	@RequestMapping(value = "eform/echart", method = RequestMethod.GET)
	public Map<String, Object> createCharts(@RequestParam(value = "rows") int rows);
	
	
	/**
	 * 获取各部门的预算情况（条件年度）
	 * @param year
	 * @return
	 */
	@RequestMapping(value = "bdm/list/budget/{year}", method = RequestMethod.GET)
	List<Map<String, Object>> getBdmInDeptByYear(@PathVariable("year") String year);
	
	/**
	 *  电子需求单获取部门预算管理
	 * @param parent
	 * @param limit
	 * @param offset
	 * @return
	 */
	@RequestMapping(value = "bdm", method = RequestMethod.GET)
	public ResultMessage<?> getBdm(@RequestParam(value = "limit") Integer limit, @RequestParam(value = "offset")  Integer offset);
	
	
	/**
	 *  部门预算情况
	 * @param dept
	 * @return
	 */
	@RequestMapping(value = "bdm/echart", method = RequestMethod.GET)
	public Map<String, Object> getBdmByDept(@RequestParam(value = "dept") String dept);

}
